<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ include file="../general/header.jsp" %>
	<div id="header">Items List</div>
	<%@ include file="../general/menu.jsp" %>
	<div id="left">
		<form:form id="id" action="advancedSearch" commandName="advancedSearchForm" method="POST" >
			<span>Name:</span>
				<form:input type="text" path="pattern" />
				<form:errors path="pattern" />
				<br />
				<br />
			<span>Category:</span> 
				<form:select name="categoryid" path="category">
						<form:option value="" label="All"/>
						<form:options items="${categories}" itemValue="id" itemLabel="name"/>
				</form:select>
				<form:errors path="category"/> 
				<br />
				<br />
			<span>State:</span>
				<form:select name="state" path="state">
						<form:option value="" label="All"/>
						<form:option value="false" label="Used"/>
						<form:option value="true" label="New"/>
				</form:select>
				<form:errors path="state"/>
				<br />
				<br />
			<span>Price Ranges: </span>
			<span>
				Mininum Price:
				<form:input type="text" name="minPrice" path="minPrice" />
				<form:errors path="minPrice" />
				Maximum Price:
				<form:input type="text" name="maxPrice" path="maxPrice" />
				<form:errors path="maxPrice" />
			</span>
			<br />
			<br />
			<input type="submit" value="Search" />
		</form:form>
		<%@ include file="../item/list.jsp" %>
	</div>
	
<br/>
<a href="../general/index">Go Back to Index</a>
<script type="text/javascript">
	hideDirection();
</script>
<%@ include file="../general/footer.jsp" %>
